package algorithm.poj.p3000;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLDecoder;
import java.util.StringTokenizer;


/**
 * 分析：
 * 实现：
 * 经验：
 * 教训：
 * 
 * 
 * @author wong.tong@gmail.com
 *
 */
public class P3187 {

	public static void main(String[] args) throws Exception {

		InputStream input = null;
		if (false) {
			input = System.in;
		} else {
			URL url = P3187.class.getResource("P3187.txt");
			File file = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
			input = new FileInputStream(file);
		}
		
		BufferedReader stdin = new BufferedReader(new InputStreamReader(input));

		String line = stdin.readLine();
		StringTokenizer st = new StringTokenizer(line);
		int N = Integer.valueOf(st.nextToken());
		int S = Integer.valueOf(st.nextToken());
		int[] ds = new int[N];
		for (int i = 0; i < N; i ++) ds[i] = i+1;
		while (ds != null) {
			if (check(ds, S)) {
				break;
			} else {
				ds = next_permutation(ds);
			}
		}
		StringBuffer sb = new StringBuffer("");
		if (ds != null) {
			for (int i = 0; i < N; i ++) {
				if (i == 0) {
					sb.append(ds[i]);
				} else {
					sb.append(" ").append(ds[i]);
				}
			}
		}
		System.out.println(sb);
	}
	
	private static boolean check(int[] ds, int S) {

		int[] ts = new int[ds.length];
		for (int i = 0; i < ds.length; i ++) {
			ts[i] = ds[i];
		}
		
		for (int i = ts.length-1; i > -1; i --) {
			for (int j = 0; j < i; j ++) {
				ts[j] += ts[j+1];
			}
		}
		return ts[0] == S;
	}

	public static int[] next_permutation(int[] ds) {
		
		int j = ds.length-2;
		for (; j > -1; j --) {
			if (ds[j+1] > ds[j]) break;
		}
		if (j == -1) {
			return null;
		} else {
			int k = ds.length-1;
			for (; k > -1; k --) {
				if (ds[k] > ds[j]) break;
			}
			int t = ds[k];
			ds[k] = ds[j];
			ds[j] = t;
			for (int i = j+1; i < (ds.length+j)/2+1; i ++) {
				int s = ds[ds.length+j-i];
				ds[ds.length+j-i] = ds[i];
				ds[i] = s;
			}
		}
		return ds;
	}

}